\chapter{Description of Web site's application use cases}
\label{WebusecasesDescription}

\textbf{Descrition of use cases for the Web site application.}

\begin{table}[ht]
\begin{tabular}{|p{\textwidth}|}
  \hline
  \rowcolor[gray]{0.9}\textbf{Name of the use case.} \\ \hline 
   Login. \\ \hline
  \rowcolor[gray]{0.9}\textbf{Summary.}\\ \hline 
   The user logs in the system. \\ \hline
  \rowcolor[gray]{0.9}\textbf{Actors} \\ \hline 
   Web user.\\ \hline
   Web administrator. \\ \hline
  \rowcolor[gray]{0.9}\textbf{Postconditions.}\\ \hline 
   The system identifies the user.\\ \hline
  \rowcolor[gray]{0.9}\textbf{Normal course} \\ \hline 
  \begin{enumerate}
   \item The user enters his nickname and password.
   \item The system checks the nickname and password. 
   \item The system returns a positive or negative confirmation.
  \end{enumerate}\\ \hline
\end{tabular}
\caption{Login use case}
\label{loginUCWeb}
\end{table}

\begin{table}[ht]
\begin{tabular}{|p{\textwidth}|}
  \hline
  \rowcolor[gray]{0.9}\textbf{Name of the use case.} \\ \hline 
   Create user acount. \\ \hline
  \rowcolor[gray]{0.9}\textbf{Summary.}\\ \hline 
   A new user wants to use our system, he enters his personal account
   information in the application and the system stores it in the database. \\ \hline
  \rowcolor[gray]{0.9}\textbf{Actors} \\ \hline 
   Web user.\\ \hline
  \rowcolor[gray]{0.9}\textbf{Postconditions.}\\ \hline 
   The user has been stored in the database and now he automatically logs in.\\ \hline
  \rowcolor[gray]{0.9}\textbf{Normal course} \\ \hline 
  \begin{enumerate}
   \item The user enters all the account information that the system requires.
   \item The system checks whether the user exists.
   \item The system returns a positive or negative confirmation.
   \item The user logs in to home page automatically after the positive confirmation.
  \end{enumerate}\\ \hline
  \rowcolor[gray]{0.9}\textbf{Alternatives courses.} \\ \hline 
   If the nickname already exists, the user must choose other nickname.
  \\\hline
\end{tabular}
\caption{Create user account use case}
\label{createUCWeb}
\end{table}

\begin{table}[ht]
\begin{tabular}{|p{\textwidth}|}
  \hline
  \rowcolor[gray]{0.9}\textbf{Name of the use case.} \\ \hline 
   Show friends last position.\\ \hline
  \rowcolor[gray]{0.9}\textbf{Summary.}\\ \hline 
   The system displays a map with the last position of the user's friends.\\ \hline
  \rowcolor[gray]{0.9}\textbf{Actors} \\ \hline 
   Web user.\\ \hline
  \rowcolor[gray]{0.9}\textbf{Preconditions}\\ \hline 
   The user must have logged in the system.\\ \hline
  \rowcolor[gray]{0.9}\textbf{Normal course} \\ \hline 
  \begin{enumerate}
   \item The user select the option to show the friends last position.
   \item The system displays a map showing the last position of the user's friends.
  \end{enumerate}\\ \hline
\end{tabular}
\caption{Show friends last position use case}
\label{showFriendsLastWeb}
\end{table}

\begin{table}[ht]
\begin{tabular}{|p{\textwidth}|}
  \hline
  \rowcolor[gray]{0.9}\textbf{Name of the use case.} \\ \hline 
   Show users last position.\\ \hline
  \rowcolor[gray]{0.9}\textbf{Summary.}\\ \hline 
   The system displays a map with the last position of all the users that are in the system.\\ \hline
  \rowcolor[gray]{0.9}\textbf{Actors} \\ \hline 
   Web administrator.\\ \hline
  \rowcolor[gray]{0.9}\textbf{Preconditions}\\ \hline 
   The administrator must have logged in the system.\\ \hline
  \rowcolor[gray]{0.9}\textbf{Normal course} \\ \hline 
  \begin{enumerate}
   \item The administrator select the option to show the users last position.
   \item The system displays a map showing the last position of all the users that are in the system. 
  \end{enumerate}\\ \hline
\end{tabular}
\caption{Show users last position use case}
\label{showUsersLastWeb}
\end{table}

\begin{table}[ht]
\begin{tabular}{|p{\textwidth}|}
  \hline
  \rowcolor[gray]{0.9}\textbf{Name of the use case.} \\ \hline 
   Show personal account. \\ \hline
  \rowcolor[gray]{0.9}\textbf{Summary.}\\ \hline 
   The user can see his personal account information. \\ \hline
  \rowcolor[gray]{0.9}\textbf{Dependency} \\ \hline 
   The use case \emph{Modify personal account} extends this use case.\\ \hline
  \rowcolor[gray]{0.9}\textbf{Actors} \\ \hline 
   Web user.\\ \hline
   Web administrator.\\ \hline
  \rowcolor[gray]{0.9}\textbf{Preconditions}\\ \hline 
   The administrator or user must have logged in the system.\\ \hline
  \rowcolor[gray]{0.9}\textbf{Normal course} \\ \hline 
  \begin{enumerate}
   \item The user or administrator selects the option to see his personal account information.
   \item The system shows the personal account information of the user or administrator.
   \item If the user or administrator wants to modify his personal data, starts the use case \emph{Modify personal account}
  \end{enumerate}\\ \hline
\end{tabular}
\caption{Show personal account use case}
\label{showPersonalAccountUCWeb}
\end{table}

\begin{table}[ht]
\begin{tabular}{|p{\textwidth}|}
  \hline
  \rowcolor[gray]{0.9}\textbf{Name of the use case.} \\ \hline 
   Modify personal account\\ \hline
  \rowcolor[gray]{0.9}\textbf{Summary.}\\ \hline 
   The user or administrator modifies his personal account information.\\ \hline
  \rowcolor[gray]{0.9}\textbf{Dependency} \\ \hline 
   This use case extends the use case \emph{Show personal account}.\\ \hline
  \rowcolor[gray]{0.9}\textbf{Actors} \\ \hline 
   Web user.\\ \hline
   Web administrator.\\ \hline
  \rowcolor[gray]{0.9}\textbf{Preconditions}\\ \hline 
   The administrator or user must have logged in the system.\\ \hline
  \rowcolor[gray]{0.9}\textbf{Postconditions.}\\ \hline 
   The changes of the account information have been stored in the database.\\ \hline
  \rowcolor[gray]{0.9}\textbf{Normal course} \\ \hline 
  \begin{enumerate}
   \item The user or administrator modifies his account information and then his presses 'Submit'.
   \item The system stores the changes.
  \end{enumerate}\\ \hline
\end{tabular}
\caption{Modify personal account use case}
\label{changepersonalAccountUCWeb}
\end{table}

\begin{table}[ht]
\begin{tabular}{|p{\textwidth}|}
  \hline
  \rowcolor[gray]{0.9}\textbf{Name of the use case.} \\ \hline 
   Show friends.\\ \hline
  \rowcolor[gray]{0.9}\textbf{Summary.}\\ \hline 
   The system displays all the friends of the user.\\ \hline
  \rowcolor[gray]{0.9}\textbf{Dependency} \\ \hline 
   The use case \emph{Show user's account} extends this use case.\\ \hline
   The use case \emph{Show user's history positions} extends this use case.\\ \hline 
  \rowcolor[gray]{0.9}\textbf{Actors} \\ \hline 
   Web user.\\ \hline
  \rowcolor[gray]{0.9}\textbf{Preconditions}\\ \hline 
   The user must have logged in the system.\\ \hline
  \rowcolor[gray]{0.9}\textbf{Normal course} \\ \hline 
  \begin{enumerate}
    \item The user selects the option to see all his friends.
    \item The system displays a table with all the user's friends, if he has, and in each friend line there are buttons for 
	  showing his 'Info' and his 'History'.
    \item If the user clicks on the button 'Info', then starts the use case \emph{Show user's account} showing his friend's 
	  account information.
    \item If the user clicks on the button 'History', then starts the use case \emph{Show user's history positions} showing in a
	  map his friend's 10 previous positions.
    \item The table shows each time 10 friends, so the user has to press 'Next' and 'Previous' buttons so as to see all his friends,
	  if they are more than 10.
  \end{enumerate}   \\ \hline
  \rowcolor[gray]{0.9}\textbf{Alternatives courses.} \\ \hline 
   If the user has no friends then the system will show a message that no people were found.\\ \hline
\end{tabular}
\caption{Show friends use case}
\label{showFriendsUCWeb}
\end{table}

\begin{table}[ht]
\begin{tabular}{|p{\textwidth}|}
  \hline
  \rowcolor[gray]{0.9}\textbf{Name of the use case.} \\ \hline 
   Show users.\\ \hline
  \rowcolor[gray]{0.9}\textbf{Summary.}\\ \hline 
   The system displays all the users that use the system.\\ \hline
  \rowcolor[gray]{0.9}\textbf{Dependency} \\ \hline 
   The use case \emph{Show user's account} extends this use case.\\ \hline
   The use case \emph{Show user's history positions} extends this use case.\\ \hline 
  \rowcolor[gray]{0.9}\textbf{Actors} \\ \hline 
   Web administrator.\\ \hline
  \rowcolor[gray]{0.9}\textbf{Preconditions}\\ \hline 
   The administrator must have logged in the system.\\ \hline
  \rowcolor[gray]{0.9}\textbf{Normal course} \\ \hline 
  \begin{enumerate}
    \item The administrator selects the option to see all the user that use the system.
    \item The system displays a table with all the users that use the system (including other administrators), if there are, and 
          in each user line there are buttons for showing his 'Info' and his 'History'.
    \item If the administrator clicks on the button 'Info', then starts the use case \emph{Show user's account} showing the user's 
	  account information.
    \item If the administrator clicks on the button 'History', then starts the use case \emph{Show user's history positions} 
          showing in a map the user's 10 previous positions.
    \item The table shows each time 10 users, so the administrator has to press 'Next' and 'Previous' buttons so as to see all the 
	  users of the system, if they are more than 10.
  \end{enumerate}   \\ \hline
  \rowcolor[gray]{0.9}\textbf{Alternatives courses.} \\ \hline 
   If the system has no users then it will show a message that no people were found.\\ \hline
  \rowcolor[gray]{0.9}\textbf{Observations.} \\ \hline 
    If the user in the table is an administrator, then the 'History' button is going to be disabled, due to the administrators
    cannot login from the mobile, so they cannot have any positions given to them.\\ \hline
\end{tabular}
\caption{Show users use case}
\label{showUsersUCWeb}
\end{table}

\begin{table}[ht]
\begin{tabular}{|p{\textwidth}|}
  \hline
  \rowcolor[gray]{0.9}\textbf{Name of the use case.} \\ \hline 
   Search user.\\ \hline
  \rowcolor[gray]{0.9}\textbf{Summary.}\\ \hline 
   The administrator searches a user in the database by name, surname, country or nick.\\ \hline
  \rowcolor[gray]{0.9}\textbf{Dependency} \\ \hline 
   The use case \emph{Delete user} extends this use case.\\ \hline
   The use case \emph{Show user's account} extends this use case.\\ \hline
   The use case \emph{Show user's history positions} extends this use case.\\ \hline
  \rowcolor[gray]{0.9}\textbf{Actors} \\ \hline 
   Web administrator.\\ \hline
  \rowcolor[gray]{0.9}\textbf{Preconditions}\\ \hline 
   The administrator must have logged in the system.\\ \hline
  \rowcolor[gray]{0.9}\textbf{Normal course} \\ \hline 
  \begin{enumerate}
  \item The administrator selects the option to search for users.
  \item The administrator enters search tags.
  \item The system displays a table of the users found, if any were found. And in each user line there are buttons for 'Delete'
	  a user, show his 'Info' and his 'History'.
  \item If the administrator clicks on the button 'Delete', then starts the use case \emph{Delete user} deleting the user's 
	  account from the database.
  \item If the administrator clicks on the button 'Info', then starts the use case \emph{Show user's account} showing the user's 
	  account information.
  \item If the administrator clicks on the button 'History', then starts the use case \emph{Show user's history positions} 
          showing in a map the user's 10 previous positions. 
  \end{enumerate}\\ \hline
  \rowcolor[gray]{0.9}\textbf{Alternatives courses.} \\ \hline 
   If there are no user matches, then it will show a message that there were not found people with the given details.\\ \hline
  \rowcolor[gray]{0.9}\textbf{Observations.} \\ \hline 
    If the user in the table is an administrator, then the 'Delete' and 'History' button is going to be disabled, due to the 
    administrators cannot be deleted and cannot login from the mobile, so they cannot have any positions given to them.\\ \hline
\end{tabular}
\caption{Search user use case}
\label{searchuserUCWeb}
\end{table}

\begin{table}[ht]
\begin{tabular}{|p{\textwidth}|}
  \hline
  \rowcolor[gray]{0.9}\textbf{Name of the use case.} \\ \hline 
   Show user's account.\\ \hline
  \rowcolor[gray]{0.9}\textbf{Summary.}\\ \hline 
   The system shows the chosen user's account information. \\ \hline
  \rowcolor[gray]{0.9}\textbf{Dependency} \\ \hline 
   This use case extends \emph{Show friends}, \emph{Show users} and \emph{Search user}.\\ \hline
  \rowcolor[gray]{0.9}\textbf{Actors} \\ \hline 
   Web user.\\ \hline
   Web administrator.\\ \hline
  \rowcolor[gray]{0.9}\textbf{Normal course} \\ \hline 
  \begin{enumerate}
    \item The system shows the chosen user's account information in a table.
  \end{enumerate}\\ \hline
  \rowcolor[gray]{0.9}\textbf{Observations.} \\ \hline 
    This use case extends \emph{Show friends} and \emph{Show users}. If the use case is called by \emph{Show friends}, it 
    displays the chosen user's account without information whether he is an administrator or not, otherwise if the use case 
    is called  by \emph{Show users}, it displays the chosen user's account including the information whether he is an 
    administrator or not.\\\hline
\end{tabular}
\caption{Show user's account use case}
\label{showMyAccountUCWeb}
\end{table}

\begin{table}[ht]
\begin{tabular}{|p{\textwidth}|}
  \hline
  \rowcolor[gray]{0.9}\textbf{Name of the use case.} \\ \hline 
   Show user's history positions.\\ \hline
  \rowcolor[gray]{0.9}\textbf{Summary.}\\ \hline 
   The system shows in a map the user's 10 previous positions. \\ \hline
  \rowcolor[gray]{0.9}\textbf{Dependency} \\ \hline 
   This use case extends \emph{Show friends} \emph{Show users} and \emph{Search user}.\\ \hline
  \rowcolor[gray]{0.9}\textbf{Actors} \\ \hline 
   Web user.\\ \hline
   Web administrator.\\ \hline
  \rowcolor[gray]{0.9}\textbf{Normal course} \\ \hline 
  \begin{enumerate}
    \item The system shows the chosen user's 10 previous position in a map.
  \end{enumerate}\\ \hline
  \rowcolor[gray]{0.9}\textbf{Alternatives courses.} \\ \hline 
   \begin{enumerate}
    \item If the user has no history of previous positions, then the system will display the map with no markers on it
    \item If the user has less than 10 previous positions in his history, in the map will be shown less than 10 markers depending
	  on the number of his previous history positions.
   \end{enumerate}\\ \hline
\end{tabular}
\caption{Show user's history positions use case}
\label{showHistoryPositionsUCWeb}
\end{table}

\begin{table}[ht]
\begin{tabular}{|p{\textwidth}|}
  \hline
  \rowcolor[gray]{0.9}\textbf{Name of the use case.} \\ \hline 
   Delete user.\\ \hline
  \rowcolor[gray]{0.9}\textbf{Summary.}\\ \hline 
   The system deletes a user from the database. \\ \hline
  \rowcolor[gray]{0.9}\textbf{Dependency} \\ \hline 
   This use case extends \emph{Search user}.\\ \hline
  \rowcolor[gray]{0.9}\textbf{Actors} \\ \hline 
   Web administrator.\\ \hline
  \rowcolor[gray]{0.9}\textbf{Normal course} \\ \hline 
  \begin{enumerate}
    \item The system deletes the user from the database.
    \item The system returns a positive o negative confirmation.
  \end{enumerate}\\ \hline
\end{tabular}
\caption{Delete user use case}
\label{deleteUserUCWeb}
\end{table}

\begin{table}[ht]
\begin{tabular}{|p{\textwidth}|}
  \hline
  \rowcolor[gray]{0.9}\textbf{Name of the use case.} \\ \hline 
   Create admin account.\\ \hline
  \rowcolor[gray]{0.9}\textbf{Summary.}\\ \hline 
   The administrator enters the personal account information of the new administrator in the application and the system
   stores the new administrator's account in the database.\\ \hline
  \rowcolor[gray]{0.9}\textbf{Actors} \\ \hline 
   Web administrator.\\ \hline
  \rowcolor[gray]{0.9}\textbf{Normal course} \\ \hline 
  \begin{enumerate}
   \item The administrator select the option to ceate new administrator account.
   \item The system displays a form so as to be completed by the administrator with the account information of the new administrator.
   \item The administrator enters the account information in the form and presses 'Submit'.
   \item The system checks whether the user exists.
   \item The system returns positive or negative confiramation.
  \end{enumerate}\\ \hline
  \rowcolor[gray]{0.9}\textbf{Alternatives courses.} \\ \hline 
   If the nickname already exits, the administrator must choose other nickname.
  \\\hline
\end{tabular}
\caption{Create admin account use case}
\label{createAdminUCWeb}
\end{table}